<?php
/*
Template Name: Full News
*/
?>
<script src="<?php bloginfo('template_directory'); ?>/js/jquery-1.4.4.js" type="text/javascript"></script>
<?php get_header_news(); ?>
<div class="outer" id="contentwrap">
    <?php
//    echo $id = get_cat_ID($post);
    $category1= get_category( get_query_var( 'cat' ) );
    $cat_id = $category1->cat_ID;
    ?>
    <!--End Toppage-->
    <!-- InstanceBeginEditable name="content" -->
    <div id="content" class="giaitri home">
    <div class="contentleft">
        <div class="modslidecontentcate mod">
            <div id="featured" >
                <ul class="ui-tabs-nav">
                <?php
                global $post;
                $i=1;$j=1;
                $args = array( 'numberposts' => 4, 'category' =>  $cat_id );
                $myposts = get_posts( $args );
                foreach( $myposts as $post ) :	setup_postdata($post);
                    ?>
                    <li class="ui-tabs-nav-item" id="nav-fragment-<?php echo $i++;?>">
                        <a href="#fragment-<?php echo $j++;?>" title="<?php the_title_attribute(); ?>" >
                    <?php if ( has_post_thumbnail()) : ?>
                            <?php the_post_thumbnail('medium', array()); ?>
                    <?php else:?>
                            <img src="<?php echo catch_that_image() ?>" alt="<?php the_title(); ?>" />
                    <?php endif; ?>
                            <span><?php the_title(); ?></span>
                    </a>
                    </li>
                <?php endforeach;?>
                </ul>
                <?php
                global $post;
                $k=1;
                $args = array( 'numberposts' => 4, 'category' =>  $cat_id );
                $myposts = get_posts( $args );
                foreach( $myposts as $post ) :	setup_postdata($post);
                    ?>
                    <div id="fragment-<?php echo $k++?>" class="ui-tabs-panel" style="">
                        <?php if ( has_post_thumbnail()) : ?>
                            <?php the_post_thumbnail('medium', array('class' => 'alignleft')); ?>
                        <?php else:?>
                            <img src="<?php echo catch_that_image() ?>" alt="<?php the_title(); ?>" />
                        <?php endif; ?>
                        <div class="info" >
                            <h2><a href="<?php the_permalink(); ?>" ><?php the_title(); ?></a></h2>
                            <p><?php the_content_index(); ?><a href="<?php the_permalink(); ?>" >xem chi tiết</a></p>
                        </div>
                    </div>
                <?php endforeach;?>

            </div>
        </div>
        <!--End slider-->
        <div class="listcontentofcate mod">
        <?php

        $categories =  get_categories("child_of=$cat_id");
        foreach  ($categories as $category) {
            //Display the sub category information using $category values like $category->cat_name
            echo '<h1 class="titlemod">'.$category->name.'</h1>';
            echo '<ul>';

            foreach (get_posts('cat='.$category->term_id) as $post) {
                setup_postdata( $post );
        ?>
                <li>
                    <a href="<?php the_permalink(); ?>">
                        <?php if ( has_post_thumbnail()) : ?>
                            <?php the_post_thumbnail('medium', array('class' => 'alignleft')); ?>
                        <?php else:?>
                            <img src="<?php echo catch_that_image() ?>" alt="<?php the_title(); ?>" />
                        <?php endif; ?>
                    </a>
                <a href="<?php the_permalink(); ?>"><?php get_the_title()?></a>
                <p><?php the_content_index();?></p>
                </li>

          <?php }?>
            <div class="clr"></div>
            <a class="viewmore" href="#">Xem thêm</a>
           </ul>
        <?php  } ?>

        </div>


    </div>
        <?php get_sidebars('rightnews'); ?>
    <!--End column left-->

    <!-- InstanceEndEditable -->

</div>
  
<?php //get_footer(); ?>